package Exer01;

public class BankTest {
    public static void main(String[] args) {
        Account account = Account.getInstance();
        deposit(account);
        deposit(account);
    }

    private static void deposit(Account account) {
        new Thread(() -> {
            for (int i = 0; i < 3; i++) {
                try {
                    Thread.sleep(10);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                account.deposit(1000);
            }
        }).start();
    }
}
